﻿using System;
using System.Collections.Specialized;
using System.IO;

namespace Medianamik.UI.Web.MVP.View
{
    public abstract class UserControlModuleView : BaseUserControl, IModuleView
    {
        public event EventHandler Initialize;
        public virtual event EventHandler<RenderEventArgs> OverriddenRender;

        public NameValueCollection QueryString
        {
            get { return Page.Request.QueryString; }
        }

        public void Alert(string resourceSet, string resourceKey)
        {
            Page.Alert(Resources(resourceSet, resourceKey));
        }

        public void Redirect(string url)
        {
            Page.Response.Redirect(url);
        }

        public string ContentType
        {
            get { return Page.Response.ContentType;  }
            set { Page.Response.ContentType = value; }
        }

        public System.Globalization.CultureInfo CurrentEditionCulture
        {
            get { return Page.CurrentEditionCulture; }
        }

        public System.Globalization.CultureInfo CurrentUICulture
        {
            get { return Page.CurrentUICulture; }
        }

        public Stream InputStream
        {
            get { return Page.Request.InputStream; }
        }

        public virtual string BreadcrumbTrail
        {
            set { throw new NotImplementedException(); }
        }

        public string RawUrl
        {
            get { return Page.Request.RawUrl; }
        }
    }
}